midpos=[983,989;995,995;1025,1022;1004,1028];
slope=[-6.9  6.4 0 0];
strLeftmappath = 'G:/20110516/FixPoint/%dBEqed01.tif';
strLeftExtend = 'G:/20110516/FixPoint/%dBExd01.tif';
strDataPath = 'G:/job/LensCal/data/20110516/FixPoint';
% for I=1:4
%     strIN=sprintf(strLeftmappath,I);
%     strout=sprintf(strLeftExtend,I);
%     ExtendMap(strIN,strout);
% end
for I=1:4
    mid=midpos(I,:);
    str=sprintf(strLeftExtend,I);
    
    [Rveal, pos,mid,HoughA] = TestCalPos(str,mid+32,43,100,slope(I));%
    str = sprintf('%s/beforecut_x=%02d', strDataPath,I);
    save(str, 'Rveal', 'pos','HoughA');
end

% for I=3:4
%     mid=midpos(I,:);
%     str=sprintf(strLeftExtend,I);
%     
%     [Rveal, pos,mid,HoughA] = TestCalPos(str,mid+32,27,72,slope(I));%
%     str = sprintf('%s/beforecut_x=%02d', strDataPath,I);
%     save(str, 'Rveal', 'pos','HoughA');
% end